import java.util.*;
import local.util.MyPrint;

public class DateAndTime {    

    public static void main (String args[]) {
	DateAndTime myDT = new DateAndTime ();
	myDT.printCurrentDate();
	myDT.printCurrentTime();
    }

    public void printCurrentDate() {
	Calendar c = Calendar.getInstance();

	System.out.println("YEAR  :"+c.get(Calendar.YEAR));
	System.out.println("MONTH :"+(c.get(Calendar.MONTH)+1));
	System.out.println("DATE  :"+c.get(Calendar.DATE));

    }

    public void printCurrentTime () {
	Calendar c = Calendar.getInstance();
	System.out.println("HOUR  :"+c.get(Calendar.HOUR));
	System.out.println("MINUTE:"+c.get(Calendar.MINUTE));
	System.out.println("SECOND:"+c.get(Calendar.SECOND));
	if ( c.get(Calendar.AM_PM)==1) {
	    System.out.println(" PM");
	}
	else {
	    System.out.println(" AM");
	}
    }

    public String getCurrentDate() {
	Calendar c = Calendar.getInstance();
	return((c.get(Calendar.MONTH)+1)+"/"+c.get(Calendar.DATE)+"/"+c.get(Calendar.YEAR));
    }

    public String  getCurrentTime () {
	Calendar c = Calendar.getInstance();
	String am_pm = "";
	if ( c.get(Calendar.AM_PM)==1) {
	    am_pm = "PM";
	}
	else {
	    am_pm = "AM";
	}

	return (c.get(Calendar.HOUR)+":"+ c.get(Calendar.MINUTE)+":"+c.get(Calendar.SECOND)+" "+am_pm);
    }
}
